package es.ignapziriza.ccrypto.testing;

import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import es.ignapziriza.ccrypto.ciphers.transposition.CaesarCipher;

public class CaesarCipherTesting {

	private CaesarCipher caesar;

	@Before
	public void setUp() throws Exception {
		caesar = new CaesarCipher(false, 3);
	}

	@After
	public void tearDown() throws Exception {
		caesar = null;
	}

	@Test
	public void testCipher() {
		caesar.cipher("THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG");
		assertEquals("WKH TXLFN EURZQ IRA MXPSHG RYHU WKH ODCB GRJ",
				caesar.getCipheredText());
	}

	@Test
	public void testDecipher() {
		caesar.decipher("WKH TXLFN EURZQ IRA MXPSHG RYHU WKH ODCB GRJ");
		assertEquals("THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG",
				caesar.getCipheredText());

	}

}
